package com.snail.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.snail.config.ConfigExtraString;

public class ActivityLogin extends ActivityBase implements OnClickListener{

	private Button guestBtn;
	private Button customerBtn;
	private Button qqBtn;
	private Button weiboBtn;
	private Button registerBtn;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        
    	guestBtn = (Button)findViewById(R.id.login_select_guest);
    	guestBtn.setOnClickListener(this);
    	
    	customerBtn = (Button)findViewById(R.id.login_select_customer);
    	customerBtn.setOnClickListener(this);
    	
    	qqBtn = (Button)findViewById(R.id.login_select_qq);
    	qqBtn.setOnClickListener(this);
    	
    	weiboBtn = (Button)findViewById(R.id.login_select_weibo);
    	weiboBtn.setOnClickListener(this);
    	
    	registerBtn = (Button)findViewById(R.id.login_select_register);
    	registerBtn.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_login, menu);
        return true;
    }

	@Override
	public void onClick(View v) {
		int id = v.getId();
		
		switch(id) {
		case R.id.login_select_guest:
			//生成临时的账号，直接进入游戏大厅
			break;
		case R.id.login_select_customer:
			//进入客户登陆界面
			Intent entryCustomer = new Intent(ActivityLogin.this, ActivityLoginInstance.class);
			entryCustomer.putExtra(ConfigExtraString.LOGIN_TYPE_NAME, 1);
			startActivity(entryCustomer);
			break;
		case R.id.login_select_qq:
			//进入客户登陆界面
			Intent entryQQ = new Intent(ActivityLogin.this, ActivityLoginInstance.class);
			entryQQ.putExtra(ConfigExtraString.LOGIN_TYPE_NAME, 2);
			startActivity(entryQQ);
			break;
		case R.id.login_select_weibo:
			//进入客户登陆界面
			Intent entryWeibo = new Intent(ActivityLogin.this, ActivityLoginInstance.class);
			entryWeibo.putExtra(ConfigExtraString.LOGIN_TYPE_NAME, 3);
			startActivity(entryWeibo);
			break;
		case R.id.login_select_register:
			//进入注册界面
			Intent entryRegister = new Intent(ActivityLogin.this, ActivityRegister.class);
			startActivity(entryRegister);
			break;
		default:
			break;
		}
	}
}
